<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\models\Classes
 *
 * @property int $id
 * @property int $academic_year 学年
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @method static \Illuminate\Database\Eloquent\Builder|Classes newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Classes newQuery()
 * @method static \Illuminate\Database\Query\Builder|Classes onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|Classes query()
 * @method static \Illuminate\Database\Eloquent\Builder|Classes whereAcademicYear($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Classes whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Classes whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Classes whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Classes whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|Classes withTrashed()
 * @method static \Illuminate\Database\Query\Builder|Classes withoutTrashed()
 * @mixin \Eloquent
 */
class Classes extends Model
{
    use HasFactory;
    use SoftDeletes;

    protected $fillable = [
        'academic_year'
    ];

    public function student()
    {
        return $this->hasMany(Student::class, 'class_id', 'id');
    }
}
